import React, { Component } from 'react'
import { Topicwapper, TopicItem } from '../style';
import { connect } from 'react-redux';

 class Topic extends Component {
     
    render() {
        const { list }  = this.props
        return (
           <Topicwapper>
               {
                   list.map((item) => {
                       return (
                        <TopicItem key={item.get('id')}>
                            <img src={item.get('imgUrl')} alt="" className="topic-top" />
                            {item.get('title')}
                        </TopicItem>
                       )
                   })
               }
             
             
           </Topicwapper>
        )
    }
}
const MapStateToProps = (state) => {
    return {
        list: state.home.get('topicList')
    }
}
export default connect(MapStateToProps, null)(Topic)
